<template>
  <div class="mainCon newTaskManage">
    <div class="containercontent">
      <!--<div class="penalrow opabsolute selectw100">
        <el-button size="mini" type="primary" class="" @click="showCreateTestPenal('new')" v-if="userOpernation.add.display">创建任务</el-button>
        <el-button size="mini" type="primary" class="" @click="xaidarzyAction('D')" v-if="userOpernation.add.display">下达日任务</el-button>
        <el-button size="mini" type="primary" class="" @click="xaidarzyAction('W')" v-if="userOpernation.add.display">下达周任务</el-button>
        <el-button size="mini" type="primary" class="" @click="xaidarzyAction('M')" v-if="userOpernation.add.display">下达月任务</el-button>
      </div>-->
      <div class="seachTip selectw100">
        <div class="inlineblock verticalmiddle infoitem">
          <div class="inlineblock verticalmiddle">
            时 间
          </div>
          <div class="inlineblock verticalmiddle informationItem">
            <el-date-picker v-model="qizhiriqi" size="mini" type="daterange" clearable value-format="yyyy-MM-dd" start-placeholder="开始日期"
              end-placeholder="结束日期" @change="doSearch">
            </el-date-picker>
          </div>
        </div>

        <div class="inlineblock verticalmiddle infoitem">
          <div class="inlineblock verticalmiddle">
            名称
          </div>
          <div class="inlineblock verticalmiddle informationItem">
            <el-input style="" v-model="readTasksParams.name" size="mini" placeholder="任务名称" @keyup.enter.native="doSearch" clearable></el-input>
          </div>
        </div>


        <div class="inlineblock verticalmiddle infoitem">
          <div class="inlineblock verticalmiddle">
            状态
          </div>
          <div class="inlineblock verticalmiddle informationItem">
            <el-select v-model="readTasksParams.status" clearable placeholder="请选择" size="mini"  @change="doSearch">
              <el-option v-for="item in taskStatus" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>


          </div>
        </div>

        <div class="inlineblock verticalmiddle infoitem">
          <div class="inlineblock verticalmiddle">
            创建人
          </div>
          <div class="inlineblock verticalmiddle informationItem">

            <el-select v-model="readTasksParams.createBy" clearable placeholder="请选择" size="mini" @change="doSearch">
              <el-option v-for="item in EmployeeByLabs" :key="item.account" :label="item.name" :value="item.account">
              </el-option>
            </el-select>
          </div>
        </div>
      </div>

      <div class="seachTip selectw100">
        <div class="inlineblock verticalmiddle infoitem">
          <div class="inlineblock verticalmiddle">
            类 型
          </div>
          <div class="inlineblock verticalmiddle informationItem">
            <el-select v-model="readTasksParams.taskType" clearable placeholder="请选择" size="mini" @change="doSearch">
              <el-option v-for="item in reportWordList.itemList" :key="item.code" :label="item.name" :value="item.code">
              </el-option>
            </el-select>
          </div>
        </div>
        <div class="inlineblock verticalmiddle infoitem">
          <div class="inlineblock verticalmiddle">
            客户
          </div>
          <div class="inlineblock verticalmiddle informationItem">
            <el-select v-model="readTasksParams.client" clearable placeholder="请选择" size="mini" @change="doSearch">
              <el-option v-for="item in inspectionUnitTableDate2" :key="item.id" :label="item.name" :value="item.id">
              </el-option>
            </el-select>
          </div>
        </div>
        <div class="inlineblock basicRightDistanceA searchIcon">
          <el-button @click='doSearch' size="mini">搜索</el-button>
          <el-button @click='emptySearch' size="mini">清空</el-button>
        </div>
      </div>
      <!--<div class="penalrow selectw100" style="height:38px;">
        <div style="position: absolute;left: 50%;transform: translate(-50%,0);top: -9px;">
          <el-button v-if="!gengduoshaoxuan" @click="gengduoshaoxuan=!gengduoshaoxuan" type="text" size="small">更多筛选条件</el-button>
          <el-button v-if="gengduoshaoxuan" @click="gengduoshaoxuan=!gengduoshaoxuan" type="text" size="small">收起</el-button>
        </div>
        <el-button style="position:absolute;right:10px;" @click='doSearch' size="mini" type="primary" class="">搜索</el-button>
      </div>-->
      <!-- 操作按钮结束 -->
      <!-- 任务表格开始 -->
      <div class="separaterowTable" style="display:block;height:calc(100% - 100px)">
        <div class="tableTittle">
          <div><span class="fontImpact">1</span><span>任务列表</span></div>
          <div style="float:right;width:400px;">
            <el-button size="mini" type="primary" class="" @click="showCreateTestPenal('new')" v-if="userOpernation.add.display">创建任务</el-button>
            <el-button size="mini" type="primary" class="" @click="xaidarzyAction('D')" v-if="userOpernation.add.display">下达日任务</el-button>
            <el-button size="mini" type="primary" class="" @click="xaidarzyAction('W')" v-if="userOpernation.add.display">下达周任务</el-button>
            <el-button size="mini" type="primary" class="" @click="xaidarzyAction('M')" v-if="userOpernation.add.display">下达月任务</el-button>
          </div>
        </div>
        <el-table :data="taskListArr.data" style="width: 100%" class="tableCon taskColor" size="mini" highlight-current-row @current-change="taskTableRowSelect"
          :cell-class-name="tableCellClassName">
          <el-table-column label="序号" width="69px" fixed>
            <template slot-scope="scope">
               {{scope.$index+(readQuery.page - 1) * readQuery.pageCount + 1}}
            </template>
          </el-table-column>
          <el-table-column  prop="code" label="编号" min-width="100px" show-overflow-tooltip fixed>
          </el-table-column>
          <el-table-column prop="name" label="名称" min-width="120px"  show-overflow-tooltip fixed>
          </el-table-column>
          <el-table-column prop="clientName" label="客户" min-width="100px" show-overflow-tooltip>
          </el-table-column>
          <el-table-column prop="taskType" label="类型" :formatter="taskTypeFormatter" min-width="80px">
            <!-- <template slot-scope="scope"> -->
            <!--    <el-tag
                          :type="scope.row.taskType == '常规任务' ? 'success' : 'primary'"
                          close-transition>{{scope.row.taskType}}</el-tag>
                      </template> -->
          </el-table-column>
          <el-table-column prop="createByName" label="创建人" min-width="80px">
          </el-table-column>
          <el-table-column prop="status" label="状态" min-width="90px" :formatter="formatter">
          </el-table-column>
          <el-table-column prop="createTime" label="创建日期" min-width="145px">
            <template slot-scope="scope">
              {{scope.row.createTime.split('.')[0]}}
            </template>
          </el-table-column>
          <el-table-column prop="caozuo" label="操作" min-width="200px">
            <template slot-scope="scope">
              <el-button type="text" size="small" v-if="(scope.row.status == 2 || scope.row.status == 4) && userOpernation.update.display"
                @click="buttonClick(scope.row,'任务提交')">编辑</el-button>
                <el-button type="text" size="small" v-if="scope.row.status ==502 && userOpernation.openUpdate.display"
                  @click="buttonClick(scope.row,'任务提交')">编辑</el-button>
              <!-- <el-button v-if="scope.row.taskState=='草稿'" @click="editTask(scope.row)" type="text" size="small">编辑</el-button> -->
              <el-button type="text" size="small" @click="buttonClick(scope.row,'任务签发')" v-if="scope.row.status==501 && userOpernation.issue.display">签发</el-button>
              <el-button @click="buttonClick(scope.row,'任务详情')" type="text" size="small" v-if="userOpernation.select.display">详情</el-button>
              <el-button type="text" size="small" @click="buttonClick(scope.row,'任务复制')" v-if="userOpernation.add.display">复制</el-button>
              <!--草稿和驳回状态的删除-->
              <el-button v-if="(scope.row.status == 2 || scope.row.status == 4) && userOpernation.delete.display" type="text" size="small" @click="buttonClick(scope.row,'任务删除')">删除</el-button>
              <!--非草稿和驳回状态的删除，任务完成不能删除-->
              <el-button v-if="scope.row.status != 504 && scope.row.status != 2 && scope.row.status != 4  && userOpernation.systemDelete.display" type="text" size="small" @click="buttonClick(scope.row,'任务删除')">删除</el-button>
              <!--<el-button type="text" size="small" @click="showCreateTestPenal('copy',scope.row)">子任务</el-button>-->
              <!-- <el-button type="text" size="small" v-on:click="newReport">生成报告</el-button> -->
            </template>
          </el-table-column>
        </el-table>
        <div class="block changepages">
          <el-pagination :current-page="readQuery.page" @size-change="handleSizeChange" @current-change="handleCurrentChange" :page-sizes="[20, 50, 100, 500]"
            :page-size="readQuery.pageCount" layout="total, sizes, prev, pager, next, jumper" :total="rowNumber">
          </el-pagination>
        </div>
      </div>
      <!-- 任务表格结束 -->
      <!--</div>-->
    </div>


    <!-- 选择创建任务方式开始 -->

    <!-- 任务编辑、详情结束 -->
    <div v-if="againconfirmShow">
      <againconfirm :model = "'taskCopy'"></againconfirm>
    </div>
    <div v-if="xiadaRZYShow">
      <xiadarzy :type="rzytype"></xiadarzy>
    </div>
    <div v-if="popupShow">
      <add-bottle></add-bottle>
    </div>
    <div v-if="addqcShow">
      <addqc :yilingyangpin="[1,2,3]"></addqc>
    </div>

    <newTask v-if="refresh" :createType.sync=createType :pnowTab.sync=nowTab :newTaskTitle.sync=newTaskTitle :newTaskShow.sync=thisNewTaskShow
      :newTaskData.sync=thisNewTaskData></newTask>

    <taskdetailNew v-if="taskDetailShow" :taskDetailShow.sync="taskDetailShow" :getPlanData.sync='getPlanData' :title.sync='title'
      :showButton.sync='showButton' :showTabIndex.sync='showTabIndex'>
    </taskdetailNew>
  </div>
</template>

<script>
  import { mapState } from 'vuex'
  import $ from 'jquery'
  import addBottle from './children/addBottle.vue'

  import newTask from './newTask.vue'
  const taskdetailNew = () => import('../taskPlanManage/children/taskDetail/taskDetail.vue'); //任务详情

  const againconfirm = () => import('./children/againConfirm.vue');
  const xiadarzy = () => import('./children/xiadaRZY.vue')
  const addqc = () => import('./children/addQC.vue')

  export default {
    data() {
      let that = this;
      return {
        refresh: true,
        createType: '',
        nowTab: '',
        newTaskTitle: {},
        title: '',
        showButton: {},
        showTabIndex: [1, 2],
        thisNewTaskData: {
          newTaskBasic: {
            "name": "",
            "code": "",
            "taskType": "",
            "reportWord": "",
            "client": "",
            "doAuto": false,
            "doBlind": false,
            "source": 0,
            "status": 2,
            "sampleBeans": [],
            "uniqueCode":"",
            "offices":'ALL',
          },
          newTaskPointList: [],
          newTaskItemList: [],
          newTaskMeterialList: []
        },
        getPlanData: {},
        thisNewTaskShow: false,
        taskShow: false,
        qizhiriqi: '',
        readTasksParams: {
          startTime: '',
          endTime: '',
          name: '',
          status: '',
          createBy: '',
          client: '',
          taskType: '',
        },
        readQuery: {
          page: 1,
          pageCount: 20,
        },
        rowNumber: 0,
        msg: '',
        taskname: '',

        userName: '当前用户名',
        //任务状态
        taskState: [
          {
            value: '001',
            label: '草稿'
          },
          {
            value: '002',
            label: '待签发'
          },
          {
            value: '003',
            label: '已签发'
          }
        ],
        taskStateValue: '',
        batchcreatetimestart: '2018-04-27',
        batchcreatetimeend: '2018-05-04',
        //截止日期可选范围
        pickerenddatefanwei: {
          disabledDate: function (time) {
            let timeSpace = time.getTime() < new Date((that.batchcreatetimestart ? that.batchcreatetimestart : '1970-01-01')).getTime();
            return timeSpace;
          }
        },
        datapickereditable: false,
        //任务列表
        taskListArr: [],
        samplingSource: [{
          label: "采样",
          value: 0,
        },
        {
          label: "送样",
          value: 1,
        },
        ],
        taskDetailShow: false,
        newTaskNamet: '',
        creatTaskStep: '0',
        creatTaskStatus: '',
        //客户列表

        //计划列表


        //监测点列表
        //能力参数列表

        //已选监测点 key数组
        monitoringPointsValue: [1, 4],
        nenglicanshuValue: [1, 4],
        taskTypeTableDateValue: '',
        againconfirmShow: false,
        rzytype: '',
        xiadaRZYShow: false,
        currentPage: 1,
        look360: false,
        lookJieGuo: false,
        biggtypeee: 'lingshi',
        ifnewtask: true,
        radio: '1',
        gengduoshaoxuan: false,
        renwuxiangqingyemianzhuangtai: '',
        addqcShow: false,
        popupShow: false,

      }
    },
    props: ['userOpernation'],
    computed: {
      ...mapState(['daibanItemShow','taskTypeTableDate', 'testCollection', 'enableStatus', 'reportWordList', 'inspectionUnitTableDate2', 'EmployeeByLabs', 'taskStatus','daibanItem']),
      taskListTableHeight: function () {
        return (window.innerHeight - 360)
      }
    },
		created(){
			if(this.daibanItemShow){
								this.buttonClick(this.daibanItem,'任务签发')
					this.$store.commit('passDaibanItemShow', false)
			}
       this.getStatus();
		},
    mounted() {

      console.log(this.userOpernation)
      this.$store.dispatch('dogetDictionary')
      this.$store.dispatch('taskCommonQuery')
      this.$store.dispatch('getAllClients')
      this.$store.dispatch('getEmployeeByLab')
      this.readTasks()

      // this.buttonClick({id:'f8816e415df546ac899180052b5282e6'},'任务签发')
    },
    components: {
       againconfirm, xiadarzy, addBottle, addqc, newTask, taskdetailNew
    },
    watch: {
				daibanItem(newer,older){
					if(this.daibanItemShow){
										this.buttonClick(this.daibanItem,'任务签发')
							this.$store.commit('passDaibanItemShow', false)
					}
				},
      //当开始日期改变时，改变结束日期不可选日期部分
      batchcreatetimestart: function (val) {
        if (this.batchcreatetimestart > this.batchcreatetimeend && this.batchcreatetimeend) {
          //起始日期大于结束日期  且  结束日期不为null      结束=开始
          this.batchcreatetimeend = this.batchcreatetimestart
        } else if (this.batchcreatetimestart > this.batchcreatetimeend && !this.batchcreatetimeend) {
          //起始日期大于结束日期  且  结束日期为null      此时不用重新给结束日期赋值
        } else if (this.batchcreatetimestart == this.batchcreatetimeend) {
          //起始日期等于结束日期        此时不用赋值
        } else {
          //起始日期小于结束日期，更新结束日期的绑定值，目的：刷新结束日期插件可选日期
          let zancun = this.batchcreatetimeend;
          this.batchcreatetimeend = new Date(this.batchcreatetimeend);
        }
      },
      readQuery: {
        handler(val, oldVal) {
          this.readTasks(this.readQuery)
        },
        deep: true
      },
    },
    methods: {
      // checkTaskStatus.htm
      getStatus(){
        this.$http({
          method: 'post',
          apiUrl: '/detection/checkTaskStatus.htm',
        }).then(res => {

        })
      },
      // 状态
      formatter(row, column, cellValue) {
        return this.util.changeStatus({ cellValue: cellValue, list: this.taskStatus })
      },
      emptySearch() {
        this.readTasksParams.startTime = '';
        this.readTasksParams.endTime = '';
        this.readTasksParams.name = '';
        this.readTasksParams.status = '';
        this.readTasksParams.createBy = '';
        this.readTasksParams.client = '';
        this.readTasksParams.taskType = '';
        this.qizhiriqi = "";
        this.doSearch();
      },
      // 根据状态显示不同的颜色
      tableCellClassName({ row, column, rowIndex, columnIndex }) {
        // 2.草稿  4.已驳回  501.待签发 502.待检测 503.检测中 504.已完成
        if (row.status == '4' && columnIndex == 6) {
          return "color2"
        }
        if (row.status == '501' && columnIndex == 6) {
          return "color3"
        }
        if (row.status == '502' && columnIndex == 6) {
          return "color4"
        }
      },
      buttonClick(row, title) {

        if (title == "任务提交") {
          this.showButton = {
            saveButton: true,
            submitButton: true,
            auditButton: false
          }
          if (row.status == 4 || row.status == 502) {
            this.showButton.saveButton = false
          }

          this.readTask(row).then(res => {
            this.thisNewTaskData.newTaskBasic = res.data
            this.callTaskDetail(title, [0, 1, 5])
          })

        } else if (title == "任务签发") {

          this.showButton = {
            saveButton: false,
            submitButton: false,
            auditButton: true
          }
          this.readTask(row).then(res => {

            this.thisNewTaskData.newTaskBasic = res.data
            this.callTaskDetail(title, [0, 1, 5])
          })

        } else if (title == "任务删除") {
          this.deleteTask(row)
        } else if (title == "任务详情") {
          this.showButton = {
            saveButton: false,
            submitButton: false,
            auditButton: false
          }

          this.readTask(row).then(res => {

             this.taskDetailShow = true;
            this.thisNewTaskData.newTaskBasic = res.data
            this.callTaskDetail(title, [0, 1, 2, 3, 4, 5])
          })

        } else if (title == "任务复制") {
          this.readTask(row).then(res => {
            // console.log(res.data);
            delete res.data.id;
            delete res.data.status;
            delete res.data.remark;
            for(var i in res.data.sampleBeans){
               delete res.data.sampleBeans[i].id
               delete res.data.sampleBeans[i].status
               delete res.data.sampleBeans[i].deleteFlag
               for(var j in res.data.sampleBeans[i].detectBeans){
                 delete res.data.sampleBeans[i].detectBeans[j].id
                 delete res.data.sampleBeans[i].detectBeans[j].status
                 delete res.data.sampleBeans[i].detectBeans[j].deleteFlag
                 // itemBeans
                 var obj =  res.data.sampleBeans[i].detectBeans[j]
                 for(var k in obj.itemBeans){
                  delete obj.itemBeans[k].id
                  delete obj.itemBeans[k].status
                 }

               }
            }
            console.log(res.data);
            this.thisNewTaskData.newTaskBasic = res.data
            this.againconfirmShow = true
          })

        }

      },

      readTask(row) {
        var params = { id: row.id }
        if (row.status == 501) { //如果这一行是待签发，多加一个参数
          params.flag = true;
        }
        return new Promise((resolve, reject) => {
          this.$http({
            method: 'post',
            apiUrl: '/detection/readTask.htm',
            params: params,
            isJson: false,
            // isLoading:true
          }).then(res => {
            if (res.code === 0) {
              resolve(res)
            }
          })
        })
      },
      deleteTask(row) {
        this.$confirm('是否删除', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {

          this.$http({
            method: 'post',
            apiUrl: '/detection/deleteTask.htm',
            params: { id: row.id },
            isJson: false,
          }).then(res => {
            if (res.code === 0) {

              this.$message({
                showClose: true,
                message: '删除成功！',
                type: 'success'
              })
              this.readTasks()
            }
          })
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });
        });


      },
      callTaskDetail(title, showTabIndex) {
        this.title = title
        this.showTabIndex = showTabIndex
        this.taskDetailShow = true;
        this.getPlanData = this.thisNewTaskData.newTaskBasic
        // this.getPlanData = this.changeData(this.thisNewTaskData.newTaskBasic)
        // this.getPlanData = this.$cloneObj(this.thisNewTaskData.newTaskBasic)
      },
      // changeData(data){
      //   data.sampleBeans = data.sampleBeans;
      //   return data;
      // },
      showCreateTestPenal(type, row) {
        this.thisNewTaskShow = true
        this.thisNewTaskData = {
          newTaskBasic: {
            "collectionDate": "",
            "name": "",
            "code": "",
            "taskType": "",
            "reportWord": "",
            "client": "",
            "doAuto": false,
            "doBlind": false,
            "source": 0,
            "status": 2,
            "sampleBeans": [],
            "offices":'ALL',
          },
          newTaskPointList: [],
          newTaskItemList: [],
          newTaskMeterialList: []
        }
        this.nowTab = 'newWay';
        this.createType = '任务创建'
        if (row) {
          this.thisNewTaskData.newTaskBasic = Object.assign({}, this.thisNewTaskData.newTaskBasic, row);
          this.thisNewTaskData.newTaskBasic.name = this.thisNewTaskData.newTaskBasic.name + '(子任务)';
          this.nowTab = 'taskBasicInfo';
          this.createType = '子任务创建'
        }
        this.newTaskTitle = {
          newWay: '任务导航-第一步-选择创建方式',
          taskModel: '任务导航-第二步-选择任务模板',
          taskBasicInfo: '任务导航-第二步-任务基础信息',
          selectCheckPiont: '任务导航-第三步-选择监测点',
          addQc: '任务导航-第四步-添加现场质控',
          addCheckItem: '任务导航-第五步-添加检测项目',
          sampleInfo: '任务导航-第六步-样品信息',

        };

      },
      taskTypeFormatter(row, column, cellValue, index) {
        let filterArr = [];
        if (this.reportWordList.length == 0) {
          return cellValue
        }
        filterArr = this.reportWordList.itemList.filter(item => item.code == cellValue)
        if (filterArr.length != 0) {
          return filterArr[0].name
        }

      },
      doSearch() {
        this.readQuery.page = 1;
        this.readTasks();
      },
      readTasks() {
        if (this.qizhiriqi == null) {
          this.readTasksParams.startTime = ""
          this.readTasksParams.endTime = ""

        } else {
          this.readTasksParams.startTime = this.qizhiriqi[0]
          this.readTasksParams.endTime = this.qizhiriqi[1]
        }
        this.readTasksParams.page = this.readQuery.page;
        this.readTasksParams.pageCount = this.readQuery.pageCount;
        this.$http({
          method: 'post',
          apiUrl: '/detection/readTasks.htm',
          params: this.readTasksParams,
          isJson: true,
        }).then(res => {
          if (res.code === 0) {
            this.taskListArr = res;
            if (!res.pageinfo) {
              this.rowNumber = 0;
            } else if (res.pageinfo && !res.pageinfo.rowNumber) {
              this.rowNumber = 0;
            } else {
              this.rowNumber = res.pageinfo.rowNumber;
            }

          }
        }, )

      },
      handleSizeChange(val) {
        this.readQuery.pageCount = val;
      },
      handleCurrentChange(val) {
        this.readQuery.page = val;
      },
      //筛选任务类型，传入筛选值、行信息   如果value是多个值会循环筛选
      filterTag(value, row) {
        return row.taskType === value;
      },
      editTask(row) {
        this.taskDetailShow = true;
        this.look360 = true;
        this.lookJieGuo = false;
        this.ifnewtask = false;
      },
      taskTableRowSelect() {

      },
      //关不创建任务面板
      closeCreatePenal() {
        this.creatTaskStep = '0';
        this.creatTaskStatus = '';
      },
      //常规创建
      routineCreate() {
        this.creatTaskStep = '2';
        this.creatTaskStatus = 'routine';
      },
      //通过模板创建
      templateCreate() {
        this.creatTaskStep = '2';
        this.creatTaskStatus = 'template';
      },
      //
      gobackFirstStep() {
        this.creatTaskStep = '1';
        this.creatTaskStatus = '';
      },
      gotoThirdStep() {
        this.creatTaskStep = '3';
      },
      goto4Step() {
        this.creatTaskStep = '4';
      },
      goto5Step() {
        this.creatTaskStep = '5';
      },
      gobackSecondStep() {
        this.creatTaskStep = '2';
      },
      gobackThirdStep() {
        this.creatTaskStep = '3';
      },
      completeCreatePrelude(type) {
        this.closeCreatePenal();
        this.renwuxiangqingyemianzhuangtai = type;
        this.taskDetailShow = true;
      },
      dakairenwuxiangqing(type) {
        this.renwuxiangqingyemianzhuangtai = type;
        this.taskDetailShow = true;
      },
      newReport() {

      },
      xaidarzyAction(type) {
        this.xiadaRZYShow = true;
        this.rzytype = type;
      },
      lookSampleJieguo() {
        this.taskDetailShow = true;
        this.look360 = false;

        this.lookJieGuo = true;
      },
      shifouzaiyoubian(option) {
        var arrrr = this.monitoringPointsValue;
        var flag = 'hide';
        for (var i = 0; i < arrrr.length; i++) {
          if (option.key == arrrr[i]) {
            flag = '';
            return
          }
        };
        return flag;
      },
      shifouzaiyoubian2(option) {
        var arrrr = this.nenglicanshuValue;
        var flag = 'zuo';
        for (var i = 0; i < arrrr.length; i++) {
          if (option.key == arrrr[i]) {
            flag = 'you';
            return flag
          }
        };
        return flag;
      },
      tianjiaxianchangqc(option, event) {
        event.preventDefault()
        option.px = !option.px
      },
      tianjiaxcjiabiaoqc(option, event) {
        event.preventDefault()
        option.jb = !option.jb
      }
    }
  }

</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .newTaskManage .infoitem {
    width: calc(100%/4 - 10px);
  }

  .newTaskManage .seachTip {
    height: 50px;
  }

  .newTaskManage .seachTip .informationItem {
    width: calc(100% - 50px);
  }

  .infoitem:nth-of-type(4) {
    padding-right: 0;
  }
</style>
<style>
  .newTaskManage .taskColor .color2 {
    color: #faa646;
  }

  .newTaskManage .taskColor .color3 {
    color: #f55e59;
  }

  .newTaskManage .taskColor .color4 {
    color: #3193f5;
  }
</style>
